feedback-vos 1.0.47 → 1.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +30 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -421,9 +421,36 @@ function ScreenshotButton({
|
|
|
421
421
|
ignoreElements: (element) => {
|
|
422
422
|
const isWidget = element.hasAttribute("data-feedback-widget") || element.closest("[data-feedback-widget]") !== null;
|
|
423
423
|
if (isWidget) return true;
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
424
|
+
const tagName = element.tagName;
|
|
425
|
+
if (tagName === "IMG" || tagName === "CANVAS" || tagName === "VIDEO" || tagName === "SVG") {
|
|
426
|
+
try {
|
|
427
|
+
const rect = element.getBoundingClientRect();
|
|
428
|
+
if (rect.width < 1 || rect.height < 1) {
|
|
429
|
+
return true;
|
|
430
|
+
}
|
|
431
|
+
if (tagName === "CANVAS") {
|
|
432
|
+
const canvas2 = element;
|
|
433
|
+
if (canvas2.width === 0 || canvas2.height === 0) {
|
|
434
|
+
console.warn("FeedbackWidget: Ignored 0-intrinsic canvas:", element);
|
|
435
|
+
return true;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
if (tagName === "IMG") {
|
|
439
|
+
const img = element;
|
|
440
|
+
if (img.getAttribute("src") && img.naturalWidth === 0) {
|
|
441
|
+
return true;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
if (tagName === "VIDEO") {
|
|
445
|
+
const video = element;
|
|
446
|
+
if (video.readyState >= 1 && (video.videoWidth === 0 || video.videoHeight === 0)) {
|
|
447
|
+
console.warn("FeedbackWidget: Ignored 0-intrinsic video:", element);
|
|
448
|
+
return true;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
} catch (e) {
|
|
452
|
+
console.warn("FeedbackWidget: Error checking element dimensions, ignoring safety check for:", element, e);
|
|
453
|
+
}
|
|
427
454
|
}
|
|
428
455
|
return false;
|
|
429
456
|
}
|